<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js worker</title>
</head>
<body>
	<div style="width:100px;margin:0 auto;">
	<span id="worker" style="text-align: center;">test11111</span>
	</div>


<script type="text/javascript">
	var worker = new Worker("./my.js");
	var bundle = {message:"hello",id:1};
	worker.postMessage(bundle);
	worker.onmessage = function(event){
		console.log(event.data);
		console.log(bundle);
		document.getElementById("worker").innerHTML = event.data.id;
	}
</script>
</body>
</html>